<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="icms.ORM.Category" %>
<%@ page import="icms.service.CategoryService" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>addArticlePanel</title>
</head>
  <body>
	<div align="center">
<form action="articlePanelMan.do?method=addArticlePanel" method="post">
<table width="56%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
	<td height="24" colspan="2" background="skin/images/tbg.gif"><input type="hidden" name="articlePanelID" value="" />添加文章panel</td>
</tr>
<!-- 文章片panel的名称 -->
<tr height="32" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td width="20%" align="right">名  称：</td>
	<td width="80%" align="left">
		<input type="text" name="articlePanelName" style="width:160px" maxlength="20" value="" />
		<%
			String nameMsg=(String)session.getAttribute("articlePanelNameError");
			if(nameMsg!=null&&(!nameMsg.equals(""))){
				out.write("<font color='red'>"+nameMsg+"</font>");
				session.setAttribute("articlePanelNameError",null);
			}
		%>
	</td>
</tr>

<!-- 文章panel的显示页面 -->
<tr height="32" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td width="20%" align="right">所属页面：</td>
	<td width="80%" align="left">
		<select name="pageID" style="width:160px">
			<% //所有一级栏目页
					CategoryService service=new CategoryService();
					List categoryList=service.getAllParentCategory();
					for(int i=0;i<categoryList.size();i++){
						Category thisCategory=(Category)categoryList.get(i);
						//栏目id
						int value=thisCategory.getCategoryID();
						//栏目名称
						String text=thisCategory.getCategoryName();
						out.write("<option value='"+value+"'>"+text+"</option>");
					}
				//首页
				out.write("<option value='0'>首页</option>");
			 %>
		</select>
	</td>
</tr>

<!-- 文章的来源（二级栏目） -->
<tr height="32" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td width="20%" align="right">文章来源：</td>
	<td width="80%" align="left">
		<select name="sourceID" style="width:160px">
			<% //所有二级级栏目页
					categoryList=service.getAllChildCategory();
					for(int i=0;i<categoryList.size();i++){
						Category thisCategory=(Category)categoryList.get(i);
						//栏目id
						int value=thisCategory.getCategoryID();
						//栏目名称
						String text=thisCategory.getCategoryName();
						out.write("<option value='"+value+"'>"+text+"</option>");
					}
			 %>
		</select>
	</td>
</tr>

<!-- 文章选取原则 -->
<tr height="32" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td width="20%" align="right">选取原则：</td>
	<td width="80%" align="left">
		 <input type="radio" name="pickPriciple"  value="1">点击量(逆序)&nbsp;
         <input type="radio" name="pickPriciple" checked value="2">时间(逆序)&nbsp;
	</td>
</tr>

<!-- 选取文章的最大数量 -->
<tr height="32" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td  align="right">数  量：</td>
	<td  align="left">
		<input type="text" name="articleQuantity" style="width:40px" maxlength="3" value="" />
		<%
			String quantityMsg=(String)session.getAttribute("articleQuantityError");
			if(quantityMsg!=null&&(!quantityMsg.equals(""))){
				out.write("<font color='red'>"+quantityMsg+"</font>");
				session.setAttribute("articleQuantityError",null);
			}
		%>
	</td>

</tr>

<!-- 文章panel的介绍 -->
<tr height="80" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td  align="right" valign="top">介  绍：</td>
	<td  align="left" valign="top">
		<textarea name="articlePanelIntroduce" style="width:280px; height:60px;"></textarea>
	</td>
</tr>

<tr height="20" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
	<td  align="center" colspan="2">
		<input type="submit" value="保  存"  />&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="reset" value="取  消"  />
	</td>
</tr>

<!-- 显示添加成功消息 -->
<tr height="20">
	<td  align="center" colspan="2">
		<%
			String news=(String)session.getAttribute("addArticlePanelNews");
			if(news!=null && (!news.equals("")) ){
				out.write("<font color='red'>"+news+"</font>");
			}
			session.setAttribute("addArticlePanelNews",null);
		 %>
		&nbsp;
	</td>
</tr>

</table>
</div>
</form>
  </body>
</html>
